// ${desc}
@Override
public void ${service}(${service?cap_first}Request request, StreamObserver<${service?cap_first}Response> responseObserver) {
    Map<String, Object> ins = new HashMap<>(1);
    ins.put("I_CZR", request.getCzr());
    <#list paramsMap?keys as key>
    <#if paramsMap[key].fieldType == "int">
    if (${service?cap_first}Request.Check${(key?replace("_",""))?cap_first}Case.${(key?replace("_",""))?upper_case} == request.getCheck${(key?replace("_",""))?cap_first}Case()) {
        ins.put("I_${key?upper_case}", request.get${(key?replace("_",""))?cap_first}());
    }
    </#if>
    <#if paramsMap[key].fieldType == "string">
    ins.put("I_${key?upper_case}", request.get${(key?replace("_",""))?cap_first}());
    </#if>
    </#list>
    <#if paging == "是">
    if (${service?cap_first}Request.CheckPagingCase.PAGING == request.getCheckPagingCase()) {
    ins.put("I_PAGING", request.getPaging());
    }
    if (${service?cap_first}Request.CheckPageNoCase.PAGENO == request.getCheckPageNoCase()) {
    ins.put("I_PAGE_NO", request.getPageNo());
    }
    if (${service?cap_first}Request.CheckPageSizeCase.PAGESIZE == request.getCheckPageSizeCase()) {
    ins.put("I_PAGE_SIZE", request.getPageSize());
    }
    </#if>
    ${service?cap_first}Response.Builder response = ${service?cap_first}Response.newBuilder();
    try {
        // 封装返回数据
        List<LinkedHashMap> resultList = baseDao.${service}(ins);
        <#if paging == "是">
        PageInfo<LinkedHashMap> pageInfo = new PageInfo<>(resultList);
        </#if>
    <#if responseType == "json_string">
        HashMap hashMap = new HashMap();
        hashMap.put("total", pageInfo.getTotal());
        List<LinkedHashMap> dataList = new ArrayList<>();
        for (LinkedHashMap linkedHashMap : resultList) {
            Iterator<Map.Entry> iterator = linkedHashMap.entrySet().iterator();
            LinkedHashMap m = new LinkedHashMap();
            while (iterator.hasNext()) {
                Map.Entry entry = iterator.next();
                m.put(getString(entry.getKey()).toUpperCase(), getString(entry.getValue()));
            }
            dataList.add(m);
        }
        hashMap.put("code", 1);
        hashMap.put("note", "查询成功！");
        hashMap.put("data", dataList); // 列表数据
        String resultStr = JSONObject.toJSONString(hashMap, SerializerFeature.WriteMapNullValue);
        response.setResult(resultStr);
    </#if>
    <#if responseType == "response">
        for(LinkedHashMap r : resultList) {
            ${service?cap_first}Record record = ${service?cap_first}Record.newBuilder()
            <#list responseParamsMap?keys as key>
            .set${key?cap_first}(getString(r.get("${key}")))
            </#list>
            .build();
            response.addRecords(record);
        }
        response.setCode(1);
        <#if paging == "是">
        response.setTotal(pageInfo.getTotal());
        </#if>
        response.setNote("查询成功！");
    </#if>
    } catch (Exception e) {
        log.error("${desc}数据异常！", e);
        responseObserver.onError(new StatusException(Status.INTERNAL));
        return;
    }
    responseObserver.onNext(response.build());
    responseObserver.onCompleted();
}
